<%@ page language="java"  pageEncoding="UTF-8"%>
<script type="text/javascript">
var currentUrl=window.location.href;
currentUrl=currentUrl.substring(0, currentUrl.indexOf("?"));
console.log("currentUrl:"+currentUrl);
  $(function(){
	  var currentPage='${page.page}';
	  var totalPage='${page.totalPage}';
   $("#up").click(function(){
	  if(currentPage==1){
		  alert("已经是第一页");
		  return;
	  }else{
		  window.location.href=currentUrl+"?porCode=${porCode}&page=${page.page-1}";
	  }
   });
   $("#down").click(function(){
		  if(currentPage==totalPage){
			  alert("已经是末页");
			  return;
		  }else{
			  window.location.href=currentUrl+"?porCode=${porCode}&page=${page.page+1}";
		  }
	      	  
	   });
   $("#jump").blur(function(){
	   var page=$("#currentpage").val();
		 if(isNaN(page) || page<=0){ alert('请输入有效的页数！'); $("#currentpage").select(); return;}
		 if(page>totalPage) { alert('第'+page+'页不存在！');return;}
		  window.location.href=currentUrl+"l?porCode=${porCode}&page="+page;
   });
  });
  function pageSet(page){
	  window.location.href=currentUrl+"?porCode=${porCode}&page="+page;
  }
</script>

<div class="pageinfo"><span><a href="javascript:pageSet(1)">首页</a><a id="up" href="javascript:void(0)">上一页</a><a id="down" href="javascript:void(0)">下一页</a><a href="javascript:pageSet(${page.totalPage })">尾页</a></span>共${page.totalRow }条 每页${page.pageSize }条 页次：${page.page }/${page.totalPage }</div>